package nGui.controls;

import nGui.controls.Control;

class Button extends Control
{
	public var onClick(default,click) : Int -> Void;

	public function new( label : String )
	{
		super();
		this.__c = ngui_button( untyped label.__s, "BUTTON_CB" );
		init();
	}

	private function click( func : Int->Void )
	{
		Reflect.setField(this,"onClick",func);
		this.setCallback( "BUTTON_CB", onClick, this.returnType );
		return func;
	}

	static var ngui_button = neko.Lib.load("nGui","ngui_element_button",2);
}